package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicUserStatus;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicUserStatusReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicUserStatusRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicUserStatusServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicUserStatusService;

@Service("publicUserStatusService")
public class PublicUserStatusServiceImpl implements IPublicUserStatusService {
	@Autowired
	private IPublicUserStatusServer publicUserStatusServer;
	@Override
	public ServerResponse<PageData<PublicUserStatusRspVO>> getUserStatusList() {
		PageData<CPublicUserStatus> userStatusPageData = publicUserStatusServer.get_userStatus_list();
		return publicUserStatusServer.assemble_result_list(userStatusPageData);
	}

	@Override
	public ServerResponse<PublicUserStatusRspVO> addUserStatus(PublicUserStatusReqVO userStatusReqVO) {
		CPublicUserStatus userStatus = publicUserStatusServer.add_userStatus(userStatusReqVO);
		return publicUserStatusServer.assemble_result(userStatus);
	}

	@Override
	public ServerResponse<PublicUserStatusRspVO> updateUserStatus(PublicUserStatusReqVO userStatusReqVO) {
		CPublicUserStatus userStatus = publicUserStatusServer.mod_userStatus(userStatusReqVO);
		return publicUserStatusServer.assemble_result(userStatus);
	}

	@Override
	public ServerResponse<String> deleteUserStatus(String userStatusId) {
		Integer result = publicUserStatusServer.del_userStatus(userStatusId);
		return publicUserStatusServer.assemble_result_string(result);
	}
}
